home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6119 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  5.8 KB

  1. Path: dnt.dialog.com!news
  2. From: Paul Gorodyansky <paul_gorodyansky@corp.dialog.com>
  3. Newsgroups: comp.lang.pl1,comp.lang.c
  4. Subject: Re: PL/I and C
  5. Date: Thu, 22 Feb 1996 12:14:42 -0800
  6. Organization: Knight-Ridder Information, Inc.
  7. Message-ID: <312CCEB2.4AB7@corp.dialog.com>
  8. References: <4gh5ru$eng@goanna.cs.rmit.EDU.AU>
  9. NNTP-Posting-Host: pc3046.corp.dialog.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-2
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Mike Presseller <mpressel@research.westlaw.com> wrote:
  16.   > I am in the process of evaluating the development of Mainframe
  17.   > applications using C/370 and PLI under MVS. 
  18.  
  19.   For the jobs you mentioned: 
  20.     > text conversions, database maintenance and development,
  21.     > and other I/O intensive routines
  22.   PL/I is MUCH better (I am talking about mainframe):
  23.  
  24.   I. Text Processing.                         
  25.      ---------------
  26.         C does not have so extensive Text Processing built-in functions,
  27.      as PL/I does. Moreover, C has this STUPID limitation - a 'string'
  28.      in C it's a set of bytes with x'00' at the end ! But, we have
  29.      x'00' all over our source data ! It's the same symbol as any other,
  30.      there is nothing special in it. So, I HAD TO write myself ALL
  31.      string functions (sub-string, search,..) using BUFFERS, because I 
  32.      was not able to use C 'String' functions.  Obviously, functions
  33.      written by me are not so efficient as Built-in functions, 
  34.      so the productivity suffers.
  35.      Also, C does not have Variable Length strings.
  36.      Again, PL/I has BUILT-IN, effective string functions.
  37.  
  38.   II. Data Structures.                     
  39.       ---------------
  40.           In PL/I, you can consider your source record as a string,
  41.      or as SEVERAL different complex Structures, using Based variables.
  42.      C has it, too,  but with a BIG limitation - if you want to put
  43.      SEVERAL different 'masks' over your buffer, C allows ONLY simple
  44.      variables as items of these structures, not Arrays !
  45.  
  46.   III. Select/Switch statement. 
  47.        ----------------------- 
  48.        This important part of any program is VERY rudimental and hard
  49.     to use in C - you can use ONLY numbers here:
  50.       switch(my_choice) {                                 
  51.         case 0:  
  52.                ....
  53.            break;                                     
  54.         case 1: 
  55.                ....
  56.        }
  57.       
  58.      You can use Enumerations in C but they are still only NUMBERS.
  59.      In PL/I you can use any Expression (!) as a switch, that is, you
  60.      can use Character Strings here, that helps a lot while writing
  61.      Text Processing programs.                    
  62.      ----
  63.      As I heard, C was developed mostly for COMPUTATIONAL tasks - its
  64.      Text Processing options are limited.
  65.  
  66.   IV. Fixing a problem, debugging. Maintenance.
  67.       ----------------------------------------
  68.    1) C compiler DOESN'T tell me where in my LARGE set of programs
  69.        a failure occurred, unlike PL/I that tells me a Statement Number.
  70.         ( C can do it, but you must buy and use an Additional product -
  71.           debugger - 'Inspect for C'. But I am afraid, it's too costly in
  72.           a matter of time to run your Production Jobs always with Debugger).
  73.     Imagine, some Production Update failed.  Source file is HUGE.
  74.     Angry Customers call from all over the world.
  75.     This large set of programs IS NOT mine. So, I never saw neither
  76.     Source data, nor Programming Code. I MUST fix the problem in
  77.     a short time.   In C environment I HAVE TO RE-RUN (!!) whole thing
  78.     using debugger, just to BEGIN my investigation.
  79.     In my opinion, it is ABSOLUTELY unacceptable in Production
  80.     (not Research) environment.
  81.     And the following 2 things support this point:
  82.  
  83.   2)    C programs are hard to maintain, code is not easy to read.
  84.      So, in the situation I described, where this large set of programs
  85.     is 'old' and was already modified several times by several engineers, 
  86.     it is EXTREMELY hard for a person who sees these programs FIRST TIME,
  87.     to investigate and fix a problem, especially in a short time.
  88.     UNLIKE PL/I, where even not a super-programmer can easily read a
  89.     source code.
  90.  
  91.   3)    Exception(Error) Handling. C does not have it, and as far as I 
  92.      know, current version of mainframe C++ does not have it, either.
  93.      What it means...   PL/I not only tells me WHERE a failure occurred
  94.      (see item 1), but it offers me ON ERROR feature, so I know
  95.      2 VERY important things that allow me often DO NOT check HUGE
  96.      source files or HUGE programs and to fix a problem in couple hours:
  97.    a) It tells me THE REASON for failure (I don't need to spend hours
  98.       and re-run entire job with debugger to find out the reason),
  99.       for example, some I/O problem.
  100.    b) Because I asked so in ON ERROR block, I have, in failed job's
  101.       listing, values of some key variables and, THE BEST, part of
  102.       source file data where error occurred. Without debugger re-run,
  103.       I can see IMMEDIATELY, that, for example, this source file has
  104.       'dirty' data. So, I DON'T need to investigate a program's CODE at all !
  105.       Again, imagine 40 gigabyte file (!) that you have to re-run
  106.       using debugger in C environment JUST TO BEGIN your investigation, 
  107.       while with PL/I this investigation is already done !
  108.  
  109.  So, my point is, PL/I is not only BETTER that C, because PL/I code is more
  110.  readable and programs are easy to maintain, but it is just IRREPLACEABLE.
  111.  
  112.  P.S. If you need more language specific information in regards
  113.       to functionality, performance, etc., then read article by
  114.       Eberhard Sturm ( GUIDE & SHARE Conference, 1994 )
  115.           "Power Vs Adventure - PL/I and C".            WWW address is:
  116. http://www.uni-muenster.de/URZ/Mitarbeiter/EberhardSturm/PL1andC.html
  117.                                                                      
  118. -- 
  119. Paul Gorodyansky      mailto:paul_gorodyansky@corp.dialog.com
  120.